package model

import "github.com/gogf/gf/v2/util/gmeta"

type EquipmentPortIdRes struct {
	Id string `json:"id"  dc:"设备端口表id"  v:"required#设备端口id必填"`
}

//EquipmentPortInfoRes 设备的详情
type EquipmentPortInfoRes struct {
	EqId                  string `json:"eqId"   dc:"设备id" v:"required#设备id必填"`
	PortCode              int    `json:"portCode"  dc:"端口号 每个设备一般只有1~20个端口" v:"min:1|integer#端口号不能小于1|端口号必须是一个整数"`
	PortStatus            int    `json:"portStatus" d:"0"  dc:" 0 空闲 1 占用 2 禁用  3 损坏" v:"in:0,1,2,3#端口状态请按照枚举填写"`
	CumulativeElectricity int    `json:"cumulativeElectricity" dc:"累计电量 精度0.01度"`
	RemainingElectricity  int    `json:"remainingElectricity" dc:" 剩余时间  当设备模式01" `
	StartTime             string `json:"startTime"  dc:"充电开始时间"`
	PortPower             int    `json:"portPower"   dc:"实时功率"`
}

// BatchAddEquipmentPortReq 批量增加端口
type BatchAddEquipmentPortReq struct {
	EqId    string `json:"eqId"   dc:"设备id" v:"required#设备id必填"`
	PortNum int    `json:"portNum"  dc:"端口数量 每个设备一般只有1~20个端口" v:"min:1|integer#端口号不能小于1|端口号必须是一个整数"`
}

type EditEquipmentPortStatus struct {
	Id         string `json:"id"  dc:"设备端口表id"  v:"required#设备端口id必填"`
	PortStatus int    `json:"portStatus" d:"0"  dc:" 0 空闲 1 占用 2 禁用  3 损坏" v:"in:0,1,2,3#端口状态请按照枚举填写"`
}

//EquipmentPortIdAndInfoRes 设备的id详情
type EquipmentPortIdAndInfoRes struct {
	EquipmentPortInfoRes
	EquipmentPortIdRes
}

// EquipmentPortDbInfoRes 设备端口的id详情
type EquipmentPortDbInfoRes struct {
	gmeta.Meta `orm:"table:lot_equipment_port"`
	EquipmentPortInfoRes
	EquipmentPortIdRes
}

// EquipmentPortDbSearchRes 设备端口查询相关的设备
type EquipmentPortDbSearchRes struct {
	gmeta.Meta `orm:"table:lot_equipment_port"`
	EquipmentPortInfoRes
	EquipmentPortIdRes
	EquipmentInfo *EquipmentDbInfoPortRes `json:"equipment_info" dc:"设备详情" orm:"with:id=eq_id"`
}
